拓展模块 评论点赞

评论表

create table if not exists comment
(
    comment_id   int unsigned auto_increment comment '唯一标识'
        primary key,
    article_id   int unsigned                not null comment '文章ID',
    user_id      bigint                      not null comment '用户ID',
    content      text                        not null comment '评论内容',
    create_time  datetime                    not null comment '创建时间',
    update_time  datetime                    null,
    foreign key (article_id) references article (article_id),
    foreign key (user_id) references user (id)
) comment '评论表';

点赞表

create table if not exists like
(
    like_id     int unsigned auto_increment comment '唯一标识'
        primary key,
    article_id  int unsigned                not null comment '文章ID',
    user_id     bigint                      not null comment '用户ID',
    create_time datetime                    not null comment '创建时间',
    foreign key (article_id) references article (article_id),
    foreign key (user_id) references user (id)
) comment '点赞表';

项目分区导航:⬅️ 04-Spring开发社交模块小记 | 05-拓展模块 评论点赞 | ➡️ 06-用户模块RBAC模型搭建